<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" />
    <script>
      let inpu = document.querySelector("input");
      let isInput = false;
      inpu.addEventListener("compositionstart", () => {
        console.log("start");
        isInput = true;
      });
      inpu.addEventListener("compositionend", () => {
        console.log("end");
        isInput = false;
        otherfn();
      });
      inpu.addEventListener("input", () => {
        if (!input) {
          console.log("input");
          otherfn();
        }
      });
      otherfn = () => {
        console.log(inpu.value);
      };
    </script>
  </body>
</html>
